Companion
Properties
Calculates the obsolete U.S. IRS double-category average cost figures (LT/ST shares held before each sale). The IRS withdrew the method in 2011. Off by default since MD2027. When off, the work is skipped and the three totSaleSharesAvailable fields are 0.
Functions
Derive, per account, the transaction date range covering every txn whose tax date falls within taxDateRange. Use it to widen a calculation's universe so that tax date selection can see txns dated outside the requested range. Scans all of the relevant txns, so call it once, early, and only when needed.
Determine whether the specified txn type is one that actually impacts cost basis calculations i.e. typically these do: BUY, BUY_XFER, COVER, DIVIDEND_REINVEST, SELL, SELL_XFER, SHORT, MISCINC, MISCEXP these don't: BANK, DIVIDEND, DIVIDENDXFR
Validates the integrity of cost-basis lot matching for a lot-controlled Security Account. Refer: getInvalidLotMatchSellTxns for details of validation checks performed. >> if getUnmatchedSaleLots returns null or empty, then cost basis will be valid. >> passes failFast parameter true. I.e. validation check stop on first error detected.